#ifndef __IMA_LOGGER_H__
#define __IMA_LOGGER_H__

#include <log4cpp/Category.hh>

//enum LOG_LEVEL{
//		DEBUG = 0,
//		INFO,
//		NOTICE,
//		WARN,
//		ERROR,
//		ALERT
//};

//#define LOG(LOG_LEVEL, LOG_MSG) if(gpLogger) gpLogger->mpCategory->LOG_LEVEL(LOG_MSG)
#define LOG_BUFFER_SIZE	4096

#define LOG(LOG_LEVEL, FILENAME, LINENUM, LOG_MSG) if(gpLogger) { \
				char logger_msg[LOG_BUFFER_SIZE]; \
				snprintf(logger_msg, LOG_BUFFER_SIZE, "File: %s || Line: %d || Message: %s", \
								FILENAME, LINENUM, LOG_MSG); \
				gpLogger->mpCategory->LOG_LEVEL(logger_msg); \
}

class ImaLogger {
public:
	static ImaLogger* getInstance(char* pLogConfFilename);
	//int log(LOG_LEVEL loglevel, char* pLogmsg);
	~ImaLogger();
	log4cpp::Category* mpCategory;
private:
	ImaLogger();
	bool init(char* pLogConfFilename);

	static ImaLogger* mpLogger;
	log4cpp::Category* mpRootCategory;
	//log4cpp::Category* mpCategory;

};

#endif //__IMA_LOGGER_H__

